package com.zuihai.app.mvp.model;

import com.blankj.utilcode.util.LogUtils;
import com.jess.arms.di.scope.FragmentScope;
import com.jess.arms.integration.IRepositoryManager;
import com.jess.arms.mvp.BaseModel;
import com.zuihai.app.mvp.contract.DetailContract;
import com.zuihai.app.mvp.model.api.service.DetailService;
import com.zuihai.app.mvp.model.entity.BaseJson;
import com.zuihai.app.mvp.model.entity.Detail;
import com.zuihai.app.mvp.model.entity.MessageResponse;

import javax.inject.Inject;

import rx.Observable;

/**
 * Created by Administrator on 2017/5/12 0012.
 */

@FragmentScope
public class DetailModel extends BaseModel implements DetailContract.Model {

    private final DetailService mDetailService;

    @Inject
    public DetailModel(IRepositoryManager repositoryManager) {
        super(repositoryManager);
        mDetailService = mRepositoryManager.obtainRetrofitService(DetailService.class);
    }

    @Override
    public Observable<MessageResponse> deleteComment(String id) {
        return mDetailService.deleteComment(id);
    }

    @Override
    public Observable<BaseJson<Detail>> requestVideo(String id, String userId) {
        return mDetailService.requestVideo(id,userId);
    }

    @Override
    public Observable<BaseJson<Detail>> requestHeadline(String id, String userId) {
        LogUtils.e("mDetailService.requestHeadline");
        Observable<BaseJson<Detail>> observable = mDetailService.requestHeadline(id, userId);
        return observable;
    }

    @Override
    public Observable<BaseJson<Detail>> requestHot(String id, String userId) {
        return mDetailService.requestHot(id,userId);
    }

    @Override
    public Observable<BaseJson<Detail>> requestCharacter(String id, String userId) {
        return mDetailService.requestCharacter(id,userId);
    }

    @Override
    public Observable<BaseJson<Detail>> requestStory(String id, String userId) {
        return mDetailService.requestStory(id,userId);
    }

    @Override
    public Observable<BaseJson<Detail>> requestHelp(String id, String userId) {
        return mDetailService.requestHelp(id,userId);
    }

    @Override
    public Observable<BaseJson<Detail>> requestShopping(String id, String userId) {
        return mDetailService.requestShop1(id,userId);
    }

    @Override
    public Observable<BaseJson<Detail>> requestPeryphery(String id, String userId) {
        return mDetailService.requestPeryphery(id,userId);
    }

    @Override
    public Observable<BaseJson<Detail>> requestActivity(String id, String userId) {
        return mDetailService.requestActivity(id,userId);
    }

    @Override
    public Observable<BaseJson<Detail>> requestDiary(String id, String userId) {
        Observable<BaseJson<Detail>> observable = mDetailService
                .requestDiary(id, userId);
        return observable;
    }

    @Override
    public Observable<BaseJson<Detail>> requestSecret(String id, String userId) {
        Observable<BaseJson<Detail>> observable = mDetailService
                .requestSecret(id, userId);
        return observable;
    }

    public Observable<BaseJson<Detail.Comment>> requestAddComment(String id, int page, String userId) {
        return mDetailService.requestAddComment(id, page, userId);
    }

    @Override
    public Observable<BaseJson<Detail>> requestCommodity(String id, int commodityType, String userId) {
        return mDetailService.requestCommodity(id, commodityType, userId);
    }

    @Override
    public Observable<BaseJson<Detail>> requestGoodGoods(String id, String userId) {
        return mDetailService.requestGoodGoods(id,userId);
    }

    @Override
    public Observable<BaseJson<Detail>> requestService(String id, String userId) {
        return mDetailService.requestFuwu(id,userId);
    }

    @Override
    public Observable<BaseJson<Detail>> requestShop(String id, String userId) {
        return mDetailService.requestShop(id, userId);
    }

    @Override
    public Observable<MessageResponse> requestCare(String id, String userId, int isFavour) {
        return mDetailService.requestCare(id, userId, isFavour);
    }

    @Override
    public Observable<MessageResponse> commentFavour(String id, String userId, int isCare, String releaserId,String type) {
        return mDetailService.commentFavour(id, userId, isCare, releaserId);
    }

    @Override
    public Observable<MessageResponse> handlineFavour(String id, String userId, String releaserId,String cancel,String type) {
        return mDetailService.handlineFavour(id, userId, releaserId,cancel);
    }

    @Override
    public Observable<MessageResponse> secretFavour(String id, String userId, String releaserId,String cancel,String type) {
        return mDetailService.secretFavour(id, userId, releaserId,cancel);
    }

    @Override
    public Observable<MessageResponse> shopFavour(String id, String userId, String releaserId) {
        return mDetailService.shopFavour(id, userId, releaserId);
    }

    @Override
    public Observable<MessageResponse> serverFavour(String id, String userId, String releaserId) {
        return mDetailService.serverFavour(id, userId, releaserId);
    }

    @Override
    public Observable<MessageResponse> commodityFavour(String id, String userId, String releaserId) {
        return mDetailService.commodityFavour(id, userId, releaserId);
    }

    @Override
    public Observable<BaseJson<Detail.Comment>> requestAddComment(String id, String userId, String comment,String release_id,String picture,String type) {
        return mDetailService.requestAddComment(id, userId, comment,release_id,picture,type);
    }

    @Override
    public Observable<MessageResponse> headlineCollect(
            String id, String userId,String type, boolean isCollect,String releaser_id) {
        return mDetailService.handlineCollect(id, userId, type,isCollect,releaser_id);
    }

    @Override
    public Observable<MessageResponse> secretCollect(String id, String userId, boolean isCollect) {
        return mDetailService.secretCollect(id, userId, isCollect);
    }

    @Override
    public Observable<MessageResponse> shopCollect(String id, String userId, boolean isCollect) {
        return mDetailService.shopCollect(id, userId, isCollect);
    }

    @Override
    public Observable<MessageResponse> commodityCollect(String id, String userId, boolean isCollect) {
        return mDetailService.commodityCollect(id, userId, isCollect);
    }

    @Override
    public Observable<MessageResponse> serverCollect(String id, String userId, boolean isCollect) {
        return mDetailService.serverCollect(id, userId, isCollect);
    }

    @Override
    public Observable<MessageResponse> headlineInform(String id, String userId, String inform) {
        return mDetailService.headlineInform(id, userId, inform);
    }

    @Override
    public Observable<MessageResponse> secretInform(String id, String userId, String inform) {
        return mDetailService.secretInform(id, userId, inform);
    }

    @Override
    public Observable<MessageResponse> shopInform(String id, String userId, String inform) {
        return mDetailService.shopInform(id, userId, inform);
    }

    @Override
    public Observable<MessageResponse> commodityInform(String id, String userId, String inform) {
        return mDetailService.commodityInform(id, userId, inform);
    }

    @Override
    public Observable<MessageResponse> shareLuckyMoney(String id, String userId, String type) {
        return mDetailService.shareLuckyMoney(id, userId);
    }

    @Override
    public Observable<MessageResponse> requestFavourLuckyMoney(String id, String userId) {
        return mDetailService.favourLuckyMoney(id, userId);
    }

    @Override
    public Observable<MessageResponse> requestShareLuckyMoney(String id, String userId) {
        return mDetailService.shareLuckyMoney(id, userId);
    }

    @Override
    public Observable<MessageResponse> headlineAndDiaryFavourLuckyMoney(String id, String userId) {
        return mDetailService.shareLuckyMoney(id, userId);
    }

    @Override
    public Observable<MessageResponse> secretFavourLuckyMoney(String id, String userId) {
        return mDetailService.shareLuckyMoney(id, userId);
    }

    @Override
    public Observable<MessageResponse> shopFavourLuckyMoney(String id, String userId) {
        return mDetailService.shareLuckyMoney(id, userId);
    }

    @Override
    public Observable<MessageResponse> commodityFavourLuckyMoney(String id, String userId) {
        return mDetailService.shareLuckyMoney(id, userId);
    }

    @Override
    public Observable<MessageResponse> requestInform(String id, String userId, String inform, String type) {
        return mDetailService.requestInform(id,userId,inform,type);
    }

    @Override
    public Observable<BaseJson<Detail.ReplyComment>> replyComment(String releaserId, String id, String userId, String content, String beihuifu,String picture) {
        return mDetailService.replyComment(releaserId,id, userId, content,beihuifu,picture);
    }

    @Override
    public Observable<MessageResponse> haveComment(String id) {
        return mDetailService.isDeleteComment(id);
    }
}
